home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
050
/
dseeker.arc
/
DSEEKER.PAS
< prev
Wrap
Pascal/Delphi Source File
|
1986-07-08
|
2KB
|
69 lines
program dseeker;
const
alarmtime=25; {number of milliseconds to sound alarm tone}
alarmfreq=440; {alarm sound frequency, approx. 440 Hz}
type
regpack = record
ax,bx,cx,dx,bp,si,di,ds,es,flags:integer;
end;
var
drive,head,track,strtsec,numsec,veresult:integer;chb:char;stb:string[80];
biospack,savpack:regpack;
begin
repeat
clrscr;
writeln('Disk Seek/Verify/Align Utility');writeln;
write('Drive (0-3) ? ');readln(drive);
write('Head (0-1) ? ');readln(head);
write('Track (0-39) ? ');readln(track);
write('Starting sector (1-9) ? ');readln(strtsec);
write('Number of sectors to verify (max = 8 or 9 - start sector + 1) ? ');
readln(numsec);
biospack.ax := (4 shl 8) or numsec; { verify code in ah, numsec in al }
biospack.bx := 0; { dummy offset for verify }
biospack.cx := (track shl 8) or 1; { track in ch, start sector in cl }
biospack.dx := (head shl 8) or lo(drive); { head in dh, drive in dl }
biospack.es := 0; { dummy segment addr for verify }
writeln;
writeln('Ready, strike any key to start or stop ... ');
savpack := biospack;
repeat
;
until keypressed;
read(kbd); { dummy read }
repeat
intr($13,biospack); { diskette i/o call }
gotoxy(1,12);clreol;
veresult := hi(biospack.ax);
case veresult of
0:stb:='No error';
1:stb:='Bad command to BIOS--s.n.o.';
2:stb:='Bad addr mark';
3:stb:='Write protected--s.n.o.';
4:stb:='Record not found';
8:stb:='DMA overrun';
9:stb:='DMA across a 64K boundary';
16:stb:='Bad CRC';
32:stb:='NEC controller failure';
64:stb:='Bad seek';
128:stb:='Time out';
else stb:='Unknown error';
end;
writeln('Verify status = ',veresult,' (',stb,')');
if veresult <> 0 then sound(alarmfreq);
delay(alarmtime);
nosound;
delay(500-alarmtime); {do the verify about once a second}
biospack := savpack;
until keypressed;
writeln;
read(kbd);
write('Repeat (Y/N) ? ');readln(stb);
chb := stb[1];
until (chb='N') or (chb='n');
clrscr;
end.